<template>
	<view class='page'>
		<view class='salesman' v-for="(item,index) in dataList"  @tap='goCard' :data-id="item.id">
			<view class='salesman-portrait'>
				<image :src="item.avatarUrl"></image>
			</view>
			<view class='salesman-info'>
				<view class='salesman-info-name'>
					<text class='name'>{{item.name}}</text>
				</view>
				<view class='salesman-info-tel'>
					<text>{{item.mobile}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import app from '@/App.vue';
	import {
		GYZJMODEL as gyzjModel
	} from '@/utils/gyzjModel.js'
	export default {
		onLoad(options) {
			let userInfo = app.globalData.userInfo;
			this.getList(userInfo.id);
		},
		data() {
			return {
				dataList: [],
			}
		},
		methods: {
			getList: function(id) {
				gyzjModel.prototype.registrationList(id, 2).then((res) => {
					console.log(res)
					if (res.code == 1) {
						this.dataList= res.data.data;
					}
				})
			},
			//我发布的点击跳转名片
			goCard: function(e) {
				console.log(e);
				var id = e.currentTarget.dataset.id;
				console.log(id);
				uni.navigateTo({
					url: '../../../user-center/my-info/cardcase/cardcase?id=' + id,
				})
			}
		}

	}
</script>

<style>
	page {
	  width: 100%;
	  height: 100%;
	  background-color: #E6E6E6;
	}
	.page {
	  width: 100%;
	}
	
	.apply {
	  padding: 20rpx 20rpx;
	  display: flex;
	  background-color: #fff;
	  margin-top: 20rpx;
	  font-size: 28rpx;
	}
	.mar-auto {
	  margin-right: auto;
	  font-weight: 600;
	}
	.color-red {
	  color: #f94c48;
	}
	
	.salesman {
	  display: flex;
	  align-items: center;
	  /* justify-content: center; */
	  background-color: #fff;
	  margin-top: 20rpx;
	  padding: 10rpx 20rpx;
	}
	.salesman-portrait {
	  width: 120rpx;
	  height: 120rpx;
	  margin-right: 20rpx;
	}
	.salesman-portrait image {
	  width: 100%;
	  height: 100%;
	  border-radius: 50%;
	}
	.salesman-info {
	  width: 60%;
	  display: flex;
	  flex-direction: column;
	}
	.salesman-info-name {
	  width: 100%;
	  display: flex;
	  align-items: center;
	}
	.name {
	  width: 100%;
	  font-weight: 600;
	}
	
	.salesman-info-tel {
	  width: 100%;
	  display: flex;
	  align-items: center;
	}
	.salesman-info-tel image {
	  width: 40rpx;
	  height: 40rpx;
	  margin-right: 10rpx;
	}
</style>
